package com.iut.cabinet.essai;

import com.iut.cabinet.application.CabinetTechniqueException;
import com.iut.cabinet.application.GererPatientCtrl;
import com.iut.cabinet.application.HelperException;
import com.iut.cabinet.application.HelperPatient;
import com.iut.cabinet.metier.CabinetMedicalException;
import com.iut.cabinet.metier.Patient;
import com.iut.cabinet.util.Adresse;
import com.iut.cabinet.util.DateUtil;

public class testGererPatientCtrl {

	/**
	 * @param args
	 * @throws CabinetTechniqueException 
	 * @throws CabinetMedicalException 
	 * @throws HelperException 
	 */
	public static void main(String[] args) throws CabinetTechniqueException, CabinetMedicalException, HelperException {
		
		Adresse julieAdresse = new Adresse("15", "Avenue Jean Jaures", null, null, "87000", "Limoges", "France");
		Patient julie = new Patient("DUPONT", "Julie", DateUtil.toDate("1960-05-21"), false, "05-55-43-43-55", "06.06.06.06.06", "dupont.julie@tralala.fr", julieAdresse, null, "260058700112367", "LEDOC PAUL");

		
		GererPatientCtrl ctrl = new GererPatientCtrl();

		System.out.println(ctrl.listerPatients());

		System.out.println(ctrl.findPatientById(5));
		
		ctrl.modifierPatient(5, HelperPatient.toPatientDTO(julie));
		
		System.out.println(ctrl.listerPatients());
		
		ctrl.supprimerPatient(5);
		
		System.out.println(ctrl.findPatientById(5));
		
		
		
	}

}
